//
//  ViewController.m
//  提示框和警示框
//
//  Created by mir_yan on 2018/10/3.
//  Copyright © 2018年 hakeem. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

- (IBAction)alertAction:(id)sender;
- (IBAction)actionSheet:(id)sender;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)alertAction:(id)sender {
    
    UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"提示框" message:@"我喜欢你" preferredStyle:UIAlertControllerStyleAlert];
    
//    UIAlertController* action1 = [UIAlertAction actionWithTitle:@"好的" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
//        // 回调代码
//        NSLog(@"好的被点击了");
//    }];
//    
//    [alert addAction:action1];
    
    [self presentViewController:alert animated:YES completion:nil];
}

- (IBAction)actionSheet:(id)sender {
    UIAlertController* alert = [UIAlertController alertControllerWithTitle:@"警示框" message:@"禁止吸烟" preferredStyle:UIAlertControllerStyleActionSheet];
    
    [self presentViewController:alert animated:YES completion:nil];
}
@end
